{template header}
{php doAction('group_add_header')}
<div class="midder">
<div class="mc">
<h1>
[{$strGroup[groupname]}]发布帖子
</h1>

<!--{if $isGroupUser == '0'}-->
<div style="font-size:14px;padding-top:50px;text-align:center;">不好意思，你不是本组成员不能发表帖子，请加入后再发帖</div>
<!--{else}-->
<form method="POST" action="{SITE_URL}index.php?app=group&ac=add&ts=do" onsubmit="return newTopicFrom(this)"  enctype="multipart/form-data">

<style>
.thread_select{width:100%; font-size:12px; margin-left:5px; zoom:1}
.thread_select .title{float:left;width:45px;}
.thread_select .select{float:left;margin-left:15px;}
</style>

<div class="thread_select">
<div class="title">主题：</div>
<div class="select"><select name="thread_select" onchange="if($(this).val()=='0'){top.location=$(this).attr('href')}else{thread_post('{$strGroup[groupid]}',this)}"  href="{SITE_URL}{tsUrl('group','add',array('groupid'=>$strGroup[groupid]))}" id="thread_s">
<option value="0">默认主题</option>
{loop $thread_about $key $v}
<option value="{$v['dir']}">{$v['threadname']}</option>
{/loop}
</select></div>
</div>

<div class="clear"></div>

<div id="default_thread">
<table width="100%">
<tbody>

<tr><td>标签：</td><td><input style="padding:3px 0;width:300px;display:none;color:#999999" name="tag" def="多个请以,分割"  onfocus="if(this.value==$(this).attr('def')) this.value=''" onblur="if(this.value=='') this.value=$(this).attr('def')"/><input type="checkbox" name="tag_ai" checked="checked"  value="1" onclick="tag_ai_o(this)"/>自动获取</td></tr>
<tr><td width="50">标题*</td>
    <td><input style="padding:3px 0;width:600px;" type="text" name="title" /></td></tr>	

{if $arrGroupType}
<tr><td height="30">分类：</td><td>
<select name="typeid">
<option value="0">选择分类</option>
<!--{loop $arrGroupType $key $item}-->
<option value="{$item[typeid]}">{$item[typename]}</option>
<!--{/loop}-->
</select></td></tr>
{/if}


<tr>
	<td valign="top">
	内容*
    </td><td><textarea style="width:600px;height:150px;font-size:14px;" id="bbcode" name="content"></textarea></td></tr>

<tr><td>图片：</td><td><input type="file" name="picfile" /> (仅支持jpg,gif,png格式图片) <input type="checkbox" name="photoshow" value="1" />回复显示</td></tr>
<tr><td>附件：</td><td><input type="file" name="attfile" />  (仅支持zip,rar,dic,txt,pdf,ppt,docx,xls,xlsx格式附件) 下载需要<input style="width:30px;" type="text" name="attachscore" value="0" />积分 <input type="checkbox" name="attachshow" value="1" />回复显示</td></tr>

<tr><td>视频：</td><td><input style="width:300px;" name="video" /> (仅支持外部视频链接：swf格式)</td></tr>
	
	<tr><td>评论：</td><td><input type="radio" checked="select" name="iscomment" value="0" />允许 <input type="radio" name="iscomment" value="1" />不允许</td></tr>
	
	</tbody></table>
</div>		

<table width="100%">
<tbody>
 
<tr><td></td><td>

<input type="hidden" name="groupid" value="{$strGroup[groupid]}" />

<input class="submit" type="submit" value="好啦，发布"> 
<a href="{SITE_URL}{tsUrl('group','show',array('id'=>$strGroup[groupid]))}" id="back">返回</a>
</td></tr></tbody></table>

</form>
{/if}


</div>
</div>
<script>
var isS=0;
function tag_ai_o(obj){
  if($(obj).attr('checked')){
    $('input[name=\'tag\']').hide();
  }else{
   $('input[name=\'tag\']').show().val($('input[name=\'tag\']').attr('def'));
  }
}
function thread_post(gid,o){
var j=$('#thread_s');
var value=j.val();
isS=1;
 $('#default_thread').html('<div style="text-align:center;font-size:14px;padding:20px;"><img src="{SITE_URL}public/images/bigload.gif" width="48" height="48"/>正在加载主题配置 请稍后。。。</div>');
 $('.thread_select,.submit,#back').hide();
$.post("{SITE_URL}{tsUrl('group','thread',array('ts'=>'post'))}",{v:value,gid:gid},function(html){
  $('#default_thread').html(html);
  isS=0;
  clearTimeout(time);
})
}
function isSelect(){
      var j=$('#thread_s');
       var value=j.val();
      if(value!=0 && isS==0){
	   thread_post('{$strGroup[groupid]}');
	  }
	 
   
}

var time=setInterval(function(){isSelect()},100);

</script>
{php doAction('group_add_footer')}
{template footer}